#!/bin/bash
# 
# 函数: ifon
# 作用: 询问是否继续( 如果接收为空值,提示错误并要求重新输入 )
# 参数: 
#      $1: 要显示的提示语
# 接收:
#      re: 
#       有效值:
#             y
#             yes
#             Yes
#             YES
# 返回值:
#      接收的值为有效值时,函数返回正常(0),否则返回错误(1)
# 

_ifon_readme_(){
    echo -e "\t询问是否继续( 如果接收为空值,提示错误并要求重新输入 )"
}

#ifon
    echoStr=
    if [ ! "$1" ];then
        echoStr="默认提示：是否继续？"
    else
        echoStr=$1
    fi
    echoStr=$echoStr"[Y/n]: "
    if [ "$autoYes" = "y" ];then
        exit 0
    else
        read -p $echoStr re
        while [ ! "$re" ];do
            read -p "输入错误, 请重新输入: " re
        done
        
        if [ $re = "y" -o "$re" = "Y" -o "$re" = "yes" -o "$re" = "YES" -o "$re" = "Yes" ]; then
            exit 0
        fi
    fi
    exit 1
